package comone.javafour;

import java.util.Objects;

public class User {

    public void flood(Pet pet){
        pet.eat();
    }

    public void play(Pet pet){
        if(pet instanceof Dog){
            Dog dog =(Dog)pet;
            dog.fp();
        }else if(pet instanceof Cat){
            Cat cat =(Cat)pet;
            cat.yy();
        }
    }
}
